cmake_minimum_required(VERSION 3.10)

project(taskman VERSION 1.0.0 LANGUAGES CXX)

# 设置C++标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 查找GTKmm组件
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTKMM REQUIRED gtkmm-3.0)

# 包含目录
include_directories(include)

# 设置源文件
set(SOURCES
    src/main.cpp
    src/mainwindow.cpp
    src/processtable.cpp
    src/processmanager.cpp
    src/systemmonitor.cpp
    src/utils.cpp
)

# 创建可执行文件
add_executable(taskman ${SOURCES})

# 链接GTKmm库
target_link_libraries(taskman ${GTKMM_LIBRARIES})

# 设置包含目录和编译选项
target_include_directories(taskman PRIVATE ${GTKMM_INCLUDE_DIRS})
target_compile_options(taskman PRIVATE ${GTKMM_CFLAGS_OTHER} -Wall -Wextra)

# 安装规则
install(TARGETS taskman
    RUNTIME DESTINATION bin
)